﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<List<WebPortal.Models.EntityModels.Categories>>" %>

<asp:Content ID="CSS" ContentPlaceHolderID="StylesContainer" runat="server">
    <link href="../../Content/Admin.css" rel="stylesheet" type="text/css" />
</asp:Content>

<asp:Content ID="JS" ContentPlaceHolderID="ScriptContainer" runat="server">
    <script type="text/javascript" src="../../Scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery.validate.min.js"></script>
    <script type="text/javascript" src="../../Scripts/admin.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery.md5.js"></script>
    <script type="text/javascript" src="../../Scripts/cookie.js"></script>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Categories edit
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<% for (int i = 0; i < Model.Count; i++)
    { %>
    <div class="cat-edit">
    <a class="edit edit-name"><%:Model[i].Name%></a> | <a class="edit">Edit</a>
    <form action="/Categories/Edit" method="post">
        <input type="hidden" name="id" value="<%:Model[i].CategoryID%>" />
        <input name="name" value="<%:Model[i].Name%>" />
        <input type="submit" name="submit" value="Save" />
        <input type="submit" name="delete" value="Delete" />
    </form>
    </div>
<% } %>

<div class="cat-edit">
    <a class="edit edit-name">Add a new category</a>
    <form action="/Categories/Edit" method="post">
        <input type="hidden" name="id" value="0" />
        <input name="name" value="" />
        <input type="submit" name="submit" value="Save" />
    </form>
 </div>
</asp:Content>
